package cn.tedu.sp04.order.service;
import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;
import org.springframework.stereotype.Component;
@Component
public class UserFeignClientFB implements UserFeignClient{
    @Override
    public JsonResult<User> getUser(Integer userId) {
        if(Math.random()<0.4){
            return JsonResult.ok(new User(userId, "缓存name"+userId,"缓存pwd"+userId));
        }
        return JsonResult.err().msg("获取用户信息失败");
    }
    @Override
    public JsonResult addSore(Integer userId, Integer score) {
        return JsonResult.err().msg("添加积分失败");
    }
}
